var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
	res.redirect('/chat');
    //res.render('index', { title: 'Express' });

});

router.get('/chat', function(req, res, next) {
  res.render('chat', { title: ' Express' ,users: 'aa' });
});

router.get('/help', function(req, res, next) {
  res.render('help', { title: 'help Express' ,users: 'aa' });
});

router.get('/about', function(req, res, next) {
  res.render('about', { title: 'about Express' ,users: 'aa' });
});

function var_dump(obj) {
    if(typeof(obj) == "object") {
        var txt = '';
        for(key in obj)
        {
            if(typeof(obj[key]) != "object")
            {
            	txt += key + '=' + obj[key] + ',';
            }
        }
        return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + txt;
    } else {
        return "Type: "+typeof(obj)+"\nValue: "+obj;
    }
}

module.exports = router;
